/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author grillo
 */
@Embeddable
public class PianoStudioPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "matricola")
    private int matricola;
    @Basic(optional = false)
    @Column(name = "idesame")
    private int idesame;

    public PianoStudioPK() {
    }

    public PianoStudioPK(int matricola, int idesame) {
        this.matricola = matricola;
        this.idesame = idesame;
    }

    public int getMatricola() {
        return matricola;
    }

    public void setMatricola(int matricola) {
        this.matricola = matricola;
    }

    public int getIdesame() {
        return idesame;
    }

    public void setIdesame(int idesame) {
        this.idesame = idesame;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) matricola;
        hash += (int) idesame;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PianoStudioPK)) {
            return false;
        }
        PianoStudioPK other = (PianoStudioPK) object;
        if (this.matricola != other.matricola) {
            return false;
        }
        if (this.idesame != other.idesame) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.PianoStudioPK[matricola=" + matricola + ", idesame=" + idesame + "]";
    }

}
